const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('comMarketInfo', {
    id: {
      autoIncrement: true,
      type: DataTypes.INTEGER,
      allowNull: false,
      primaryKey: true,
      comment: "编号"
    },
    create_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: "2020-03-23 00:00:00",
      comment: "创建时间"
    },
    update_time: {
      type: DataTypes.DATE,
      allowNull: true,
      defaultValue: "2020-03-23 00:00:00",
      comment: "更新时间"
    },
    market_total_holder: {
      type: DataTypes.BIGINT,
      allowNull: true,
      defaultValue: 0,
      comment: "韭菜数量"
    },
    sh_total_holder: {
      type: DataTypes.BIGINT,
      allowNull: true,
      defaultValue: 0,
      comment: "上证韭菜"
    },
    sz_total_holder: {
      type: DataTypes.BIGINT,
      allowNull: true,
      defaultValue: 0,
      comment: "深证韭菜"
    },
    market_total_holder_variation: {
      type: DataTypes.BIGINT,
      allowNull: true,
      defaultValue: 0,
      comment: "韭菜变动"
    },
    sh_total_holder_variation: {
      type: DataTypes.BIGINT,
      allowNull: true,
      defaultValue: 0,
      comment: "上韭变动"
    },
    sz_total_holder_variation: {
      type: DataTypes.BIGINT,
      allowNull: true,
      defaultValue: 0,
      comment: "深韭变动"
    },
    index_sh: {
      type: DataTypes.BIGINT,
      allowNull: true,
      defaultValue: 0,
      comment: "上证指数"
    },
    index_sz: {
      type: DataTypes.BIGINT,
      allowNull: true,
      defaultValue: 0,
      comment: "深证指数"
    }
  }, {
    sequelize,
    tableName: 'com_market_info',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
